#include "TextApp.h"

TextApp::TextApp(HINSTANCE hInstance, std::string winCaption)
: D3DApp(hInstance, winCaption, D3DDEVTYPE_HAL, D3DCREATE_HARDWARE_VERTEXPROCESSING)
{
}

TextApp::~TextApp()
{
}

LRESULT TextApp::MsgProc(UINT msg
	, WPARAM wParam
	, LPARAM lParam)
{
	switch (msg)
	{
	case WM_LBUTTONDOWN:
		::MessageBoxA(0, _T("Hello World!"), _T("Left Button Down"), MB_OK);
		return 0;
	case WM_PAINT:
		PAINTSTRUCT ps;
		HDC hdc;
		hdc = BeginPaint(mhMainWindow, &ps);
		{
			RECT r;
			r.left = 0;
			r.top = 0;
			r.bottom = 50;
			r.right = 250;

			Rectangle(hdc, r.left, r.top, r.right, r.bottom);
			DrawText(hdc, _T("Salut tout le monde!"), -1, &r, DT_CENTER | DT_SINGLELINE | DT_VCENTER);
		}
		EndPaint(mhMainWindow, &ps);
		return 0;
	}
	return D3DApp::MsgProc(msg, wParam, lParam);
}
